#ifndef Delegate2_H
#define Delegate2_H

#include "Global_Signal.h"
#include "abstractDelegate.h"

template <class T, class U, class V>
class Delegate2 : public AbstractDelegate{
    public :

    Delegate2(int (T::*aPDelegate)(U,V), T * ref);

    T * objetDelegate;
    int (T::*pDelegate)(U, V);

    virtual void Run();

    template<class T>
     virtual  void Run(T arg)=0;

    template<class T, class U>
     virtual  void Run(T arg, U arg2)=0;

    template<class T, class U, class W>
     virtual  void Run(T arg, U arg2, W arg3)=0;

};


template <class T, class U, class V>
Delegate2<T,U, V>::Delegate2(int (T::*apDelegate)(U,V),T * ref){
    pDelegate=apDelegate;
    objetDelegate=ref;
}

template<class T, class U, class V>
void Delegate2<T,U,V>::Run(U arg1, V arg2){
    (objetDelegate->*pDelegate)(arg1,arg2);
}

#endif // Delegate2_H
